<?php  
	// $conn1 = mysqli_connect("localhost","root","root");
	// //构造函数
	// $conn2 = new PDO("mysql:host=localhost;","root","root");
	// var_dump($conn1);	
	// var_dump($conn2);


	try{
		//可能出现异常的代码放入try
		$conn3 = new PDO("mysql:host=localhost;","root6","root");

	}
	catch(Exception $e){
		// try内发生异常时 执行catch
		// 没有异常不执行
		echo "系统异常 稍等一会";
	}
	echo "连接成功";
	//$conn3=new PDO("mysql:host=localhost;","root123","root");
	//var_dump()
?>